<html>
<head><meta charset="utf-8"><title>SourceScopeData in .rmeta · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SourceScopeData.20in.20.2Ermeta.html">SourceScopeData in .rmeta</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="228036638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SourceScopeData%20in%20.rmeta/near/228036638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Shihao Xia <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SourceScopeData.20in.20.2Ermeta.html#228036638">(Feb 27 2021 at 06:03)</a>:</h4>
<p>Please correct me if my understanding is wrong. If a external crate found in a crate that going to be compiled, cargo will trigger rustc to generate metadata for this crate. At this time, all MIRs is also been serialized into this .rmeta file in order to be load by “local crate” through creader.</p>
<p>Is all MIR Body’s SourceScopeData also been serialized? If yes, could someone enlighten me the related code?</p>



<a name="228048207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SourceScopeData%20in%20.rmeta/near/228048207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tm <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SourceScopeData.20in.20.2Ermeta.html#228048207">(Feb 27 2021 at 10:10)</a>:</h4>
<p>The encoding traits are usually derived: <code>#[derive(Encodable)]</code>, <code>#[derive(TyEncodable)]</code>. A source scope data will be encoded as well, except for <code>ClearCrossCrate</code> types inside.</p>
<p>The entry point for encoding MIR would be <code>encode_mir</code> method in <code>compiler/rustc_metadata/src/rmeta/encoder.rs</code>. The <code>-Zalways-encode-mir</code>, might be required to encode some of MIR as by default only a MIR necessary for const eval or code generation is encoded.</p>



<a name="228096610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SourceScopeData%20in%20.rmeta/near/228096610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Shihao Xia <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SourceScopeData.20in.20.2Ermeta.html#228096610">(Feb 28 2021 at 01:43)</a>:</h4>
<p>Thanks <span class="user-mention" data-user-id="352985">@tm</span></p>



<a name="228096766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SourceScopeData%20in%20.rmeta/near/228096766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Shihao Xia <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SourceScopeData.20in.20.2Ermeta.html#228096766">(Feb 28 2021 at 01:47)</a>:</h4>
<p>For experiment, I tried to add a property(with RustcEncodable, RustcDecodable derive) in SourceScopeData, however, compiler will report error like</p>
<div class="codehilite"><pre><span></span><code>thread &#39;rustc&#39; panicked at &#39;DefId::expect_local: `DefId(2:8002 ~ core[13dc]::str[0]::{{impl}}[33]::as_bytes[0])` isn&#39;t local&#39;, /home/xsh/code/rust-compiler/src/libstd/macros.rs:16:9
stack backtrace:
   0: &lt;std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display&gt;::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::default_hook
   5: rustc_driver::report_ice
   6: std::panicking::rust_panic_with_hook
   7: rust_begin_unwind
   8: std::panicking::begin_panic_fmt
   9: rustc_span::def_id::DefId::expect_local::{{closure}}
  10: &lt;rustc_hir::hir_id::HirId as rustc_serialize::serialize::Decodable&gt;::decode
  11: &lt;rustc_middle::mir::SourceScopeData as rustc_serialize::serialize::Decodable&gt;::decode
  12: rustc_serialize::serialize::Decoder::read_seq
  13: &lt;rustc_middle::mir::Body as rustc_serialize::serialize::Decodable&gt;::decode::{{closure}}
  14: rustc_metadata::rmeta::decoder::&lt;impl rustc_metadata::creader::CrateMetadataRef&gt;::get_optimized_mir
  15: rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::optimized_mir
</code></pre></div>
<p>I suppose I messed up the binary serialized SourceScopeData. Where can I fix this issue? Some SpecializedEncoder impl maybe?</p>



<a name="228097596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SourceScopeData%20in%20.rmeta/near/228097596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SourceScopeData.20in.20.2Ermeta.html#228097596">(Feb 28 2021 at 02:05)</a>:</h4>
<p>I don't think you can serialize HirIds cross crate</p>



<a name="228097705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SourceScopeData%20in%20.rmeta/near/228097705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Shihao Xia <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SourceScopeData.20in.20.2Ermeta.html#228097705">(Feb 28 2021 at 02:07)</a>:</h4>
<p>I added a safety, and keep other things untouched..I have no idea why it tried to decode HirID...</p>
<div class="codehilite"><pre><span></span><code>#[derive(Clone, Debug, RustcEncodable, RustcDecodable, HashStable)]
pub struct SourceScopeData {
    pub span: Span,
    pub parent_scope: Option&lt;SourceScope&gt;,
    pub safety: Safety, // &lt;---------------This is I added
    /// Crate-local information for this source scope, that can&#39;t (and
    /// needn&#39;t) be tracked across crates.
    pub local_data: ClearCrossCrate&lt;SourceScopeLocalData&gt;,
}
</code></pre></div>



<a name="228097799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SourceScopeData%20in%20.rmeta/near/228097799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Shihao Xia <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SourceScopeData.20in.20.2Ermeta.html#228097799">(Feb 28 2021 at 02:09)</a>:</h4>
<p>Maybe is because of order? that position should be local_data-&gt;hirId, but now changed to the safety? Correct me if I am wrong...nvm I remembered these is a specialized encoder for ClearCrossCrate</p>



<a name="228097991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SourceScopeData%20in%20.rmeta/near/228097991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SourceScopeData.20in.20.2Ermeta.html#228097991">(Feb 28 2021 at 02:13)</a>:</h4>
<p>It's hard to tell with the back trace you posted, it's missing debug symbols so it skips frames</p>



<a name="228098015"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SourceScopeData%20in%20.rmeta/near/228098015" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SourceScopeData.20in.20.2Ermeta.html#228098015">(Feb 28 2021 at 02:13)</a>:</h4>
<p>Try setting debug = true in config.toml</p>



<a name="228098019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SourceScopeData%20in%20.rmeta/near/228098019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Shihao Xia <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SourceScopeData.20in.20.2Ermeta.html#228098019">(Feb 28 2021 at 02:13)</a>:</h4>
<p>Sure, working on that</p>



<a name="228098670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SourceScopeData%20in%20.rmeta/near/228098670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Shihao Xia <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SourceScopeData.20in.20.2Ermeta.html#228098670">(Feb 28 2021 at 02:26)</a>:</h4>
<div class="codehilite"><pre><span></span><code>#0 [optimized_mir] optimizing MIR for `rustc_std_workspace_core::mem::zeroed`
#1 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
thread &#39;rustc&#39; panicked at &#39;DefId::expect_local: `DefId(1:6664 ~ core[bafc]::slice[0]::{{impl}}[0]::iter[0])` isn&#39;t local&#39;, /home/xsh/code/rust-compiler/src/libstd/macros.rs:16:9
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /home/xsh/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /home/xsh/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:78
   3: &lt;std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display&gt;::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1076
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1537
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:198
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:217
  10: &lt;alloc::boxed::Box&lt;F&gt; as core::ops::function::Fn&lt;A&gt;&gt;::call
             at ./src/liballoc/boxed.rs:1095
  11: rustc_driver::report_ice
             at src/librustc_driver/lib.rs:1161
  12: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:530
  13: rust_begin_unwind
             at src/libstd/panicking.rs:437
  14: std::panicking::begin_panic_fmt
             at src/libstd/panicking.rs:391
  15: rustc_span::def_id::DefId::expect_local::{{closure}}
             at ./src/libstd/macros.rs:16
  16: core::option::Option&lt;T&gt;::unwrap_or_else
             at ./src/libcore/option.rs:425
  17: rustc_span::def_id::DefId::expect_local
             at ./src/librustc_span/def_id.rs:163
  18: &lt;rustc_metadata::rmeta::decoder::DecodeContext as rustc_serialize::serialize::SpecializedDecoder&lt;rustc_span::def_id::LocalDefId&gt;&gt;::specialized_decode
             at src/librustc_metadata/rmeta/decoder.rs:388
  19: &lt;T as rustc_serialize::serialize::Decodable&gt;::decode
             at ./src/librustc_serialize/serialize.rs:982
  20: core::ops::function::FnOnce::call_once
             at ./src/libcore/ops/function.rs:233
  21: rustc_serialize::serialize::Decoder::read_struct_field
             at ./src/librustc_serialize/serialize.rs:292
  22: &lt;rustc_hir::hir_id::HirId as rustc_serialize::serialize::Decodable&gt;::decode::{{closure}}
             at ./src/librustc_hir/hir_id.rs:16
  23: rustc_serialize::serialize::Decoder::read_struct
             at ./src/librustc_serialize/serialize.rs:279
  24: &lt;rustc_hir::hir_id::HirId as rustc_serialize::serialize::Decodable&gt;::decode
             at ./src/librustc_hir/hir_id.rs:14
  25: core::ops::function::FnOnce::call_once
             at ./src/libcore/ops/function.rs:233
  26: rustc_serialize::serialize::Decoder::read_enum_variant_arg
             at ./src/librustc_serialize/serialize.rs:252
  27: &lt;rustc_middle::mir::Safety as rustc_serialize::serialize::Decodable&gt;::decode::{{closure}}::{{closure}}
             at ./src/librustc_middle/mir/mod.rs:424
  28: rustc_serialize::serialize::Decoder::read_enum_variant
             at ./src/librustc_serialize/serialize.rs:244
  29: &lt;rustc_middle::mir::Safety as rustc_serialize::serialize::Decodable&gt;::decode::{{closure}}
             at ./src/librustc_middle/mir/mod.rs:416
  30: rustc_serialize::serialize::Decoder::read_enum
             at ./src/librustc_serialize/serialize.rs:235
  31: &lt;rustc_middle::mir::Safety as rustc_serialize::serialize::Decodable&gt;::decode
             at ./src/librustc_middle/mir/mod.rs:416
  32: core::ops::function::FnOnce::call_once
             at ./src/libcore/ops/function.rs:233
  33: rustc_serialize::serialize::Decoder::read_struct_field
             at ./src/librustc_serialize/serialize.rs:292
  34: &lt;rustc_middle::mir::SourceScopeData as rustc_serialize::serialize::Decodable&gt;::decode::{{closure}}
             at ./src/librustc_middle/mir/mod.rs:1742
  35: rustc_serialize::serialize::Decoder::read_struct
             at ./src/librustc_serialize/serialize.rs:279
  36: &lt;rustc_middle::mir::SourceScopeData as rustc_serialize::serialize::Decodable&gt;::decode
             at ./src/librustc_middle/mir/mod.rs:1735
  37: &lt;alloc::vec::Vec&lt;T&gt; as rustc_serialize::serialize::Decodable&gt;::decode::{{closure}}::{{closure}}
             at ./src/librustc_serialize/serialize.rs:684
  38: rustc_serialize::serialize::Decoder::read_seq_elt
             at ./src/librustc_serialize/serialize.rs:352
  39: &lt;alloc::vec::Vec&lt;T&gt; as rustc_serialize::serialize::Decodable&gt;::decode::{{closure}}
             at ./src/librustc_serialize/serialize.rs:684
  40: rustc_serialize::serialize::Decoder::read_seq
             at ./src/librustc_serialize/serialize.rs:344
  41: &lt;alloc::vec::Vec&lt;T&gt; as rustc_serialize::serialize::Decodable&gt;::decode
             at ./src/librustc_serialize/serialize.rs:681
  42: &lt;rustc_index::vec::IndexVec&lt;I,T&gt; as rustc_serialize::serialize::Decodable&gt;::decode
             at ./src/librustc_index/vec.rs:494
  43: core::ops::function::FnOnce::call_once
             at ./src/libcore/ops/function.rs:233
  44: rustc_serialize::serialize::Decoder::read_struct_field
             at ./src/librustc_serialize/serialize.rs:292
  45: &lt;rustc_middle::mir::Body as rustc_serialize::serialize::Decodable&gt;::decode::{{closure}}
             at ./src/librustc_middle/mir/mod.rs:109
  46: rustc_serialize::serialize::Decoder::read_struct
             at ./src/librustc_serialize/serialize.rs:279
  47: &lt;rustc_middle::mir::Body as rustc_serialize::serialize::Decodable&gt;::decode
             at ./src/librustc_middle/mir/mod.rs:94
  48: rustc_metadata::rmeta::decoder::&lt;impl rustc_metadata::rmeta::Lazy&lt;T,()&gt;&gt;::decode
             at src/librustc_metadata/rmeta/decoder.rs:225
  49: rustc_metadata::rmeta::decoder::&lt;impl rustc_metadata::creader::CrateMetadataRef&gt;::get_optimized_mir
             at src/librustc_metadata/rmeta/decoder.rs:1124
  50: rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::optimized_mir
             at src/librustc_metadata/rmeta/decoder/cstore_impl.rs:114
  51: rustc_middle::ty::query::&lt;impl rustc_query_system::query::config::QueryAccessors&lt;rustc_middle::ty::context::TyCtxt&gt; for rustc_middle::ty::query::queries::optimized_mir&gt;::compute
             at src/librustc_middle/ty/query/plumbing.rs:381
  52: rustc_query_system::dep_graph::graph::DepGraph&lt;K&gt;::with_task_impl
             at ./src/librustc_query_system/dep_graph/graph.rs:303
  53: rustc_query_system::query::plumbing::force_query_with_job::{{closure}}::{{closure}}
             at ./src/librustc_query_system/dep_graph/graph.rs:0
  54: rustc_middle::ty::query::plumbing::&lt;impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt&gt;::start_query::{{closure}}::{{closure}}::{{closure}}
             at src/librustc_middle/ty/query/plumbing.rs:72
  55: stacker::maybe_grow
             at /home/xsh/.cargo/registry/src/github.com-1ecc6299db9ec823/stacker-0.1.9/src/lib.rs:52
  56: rustc_data_structures::stack::ensure_sufficient_stack
             at ./src/librustc_data_structures/stack.rs:16
  57: rustc_middle::ty::query::plumbing::&lt;impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt&gt;::start_query::{{closure}}::{{closure}}
             at src/librustc_middle/ty/query/plumbing.rs:72
  58: rustc_middle::ty::context::tls::enter_context::{{closure}}
             at src/librustc_middle/ty/context.rs:1710
  59: rustc_middle::ty::context::tls::set_tlv
             at src/librustc_middle/ty/context.rs:1694
  60: rustc_middle::ty::context::tls::enter_context
             at src/librustc_middle/ty/context.rs:1710
  61: rustc_middle::ty::query::plumbing::&lt;impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt&gt;::start_query::{{closure}}
             at src/librustc_middle/ty/query/plumbing.rs:71
  62: rustc_middle::ty::context::tls::with_related_context::{{closure}}
             at src/librustc_middle/ty/context.rs:1798
  63: rustc_middle::ty::context::tls::with_context::{{closure}}
             at src/librustc_middle/ty/context.rs:1782
  64: rustc_middle::ty::context::tls::with_context_opt
             at src/librustc_middle/ty/context.rs:1771
  65: rustc_middle::ty::context::tls::with_context
             at src/librustc_middle/ty/context.rs:1782
  66: rustc_middle::ty::context::tls::with_related_context
             at src/librustc_middle/ty/context.rs:1795
  67: rustc_middle::ty::query::plumbing::&lt;impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt&gt;::start_query
             at src/librustc_middle/ty/query/plumbing.rs:60
  68: rustc_query_system::query::plumbing::force_query_with_job::{{closure}}
             at ./src/librustc_query_system/query/plumbing.rs:589
  69: rustc_query_system::query::plumbing::with_diagnostics
             at ./src/librustc_query_system/query/plumbing.rs:296
  70: rustc_query_system::query::plumbing::force_query_with_job
             at ./src/librustc_query_system/query/plumbing.rs:588
  71: rustc_query_system::query::plumbing::try_execute_query
             at ./src/librustc_query_system/query/plumbing.rs:415
  72: rustc_query_system::query::plumbing::get_query_impl::{{closure}}
             at ./src/librustc_query_system/query/plumbing.rs:639
  73: &lt;rustc_query_system::query::caches::ArenaCache&lt;K,V&gt; as rustc_query_system::query::caches::QueryCache&gt;::lookup
             at ./src/librustc_query_system/query/caches.rs:193
  74: rustc_query_system::query::plumbing::try_get_cached
             at ./src/librustc_query_system/qu
</code></pre></div>



<a name="228098701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SourceScopeData%20in%20.rmeta/near/228098701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Shihao Xia <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SourceScopeData.20in.20.2Ermeta.html#228098701">(Feb 28 2021 at 02:27)</a>:</h4>
<p>BTW, the code base is git tag 1.46.0, for some third party libraries limitation I have to work on LLVM 10...which is just before the refactor of codegen part</p>



<a name="228099001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SourceScopeData%20in%20.rmeta/near/228099001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Shihao Xia <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SourceScopeData.20in.20.2Ermeta.html#228099001">(Feb 28 2021 at 02:32)</a>:</h4>
<div class="codehilite"><pre><span></span><code>  23: rustc_serialize::serialize::Decoder::read_struct
             at ./src/librustc_serialize/serialize.rs:279
  24: &lt;rustc_hir::hir_id::HirId as rustc_serialize::serialize::Decodable&gt;::decode
             at ./src/librustc_hir/hir_id.rs:14                           &lt;---------- To here
  25: core::ops::function::FnOnce::call_once
             at ./src/libcore/ops/function.rs:233
  26: rustc_serialize::serialize::Decoder::read_enum_variant_arg        &lt;---------- Why from here
             at ./src/librustc_serialize/serialize.rs:252
  27: &lt;rustc_middle::mir::Safety as rustc_serialize::serialize::Decodable&gt;::decode::{{closure}}::{{closure}}
             at ./src/librustc_middle/mir/mod.rs:424                      &lt;------ trying to decode Safety
  28: rustc_serialize::serialize::Decoder::read_enum_variant
             at ./src/librustc_serialize/serialize.rs:244
  29: &lt;rustc_middle::mir::Safety as rustc_serialize::serialize::Decodable&gt;::decode::{{closure}}
             at ./src/librustc_middle/mir/mod.rs:416
</code></pre></div>



<a name="228099493"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SourceScopeData%20in%20.rmeta/near/228099493" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Shihao Xia <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SourceScopeData.20in.20.2Ermeta.html#228099493">(Feb 28 2021 at 02:42)</a>:</h4>
<p>Oh I see, there is an ExplicitUnsafe(hir::HirId) in Safety</p>



<a name="228099566"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SourceScopeData%20in%20.rmeta/near/228099566" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Shihao Xia <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SourceScopeData.20in.20.2Ermeta.html#228099566">(Feb 28 2021 at 02:44)</a>:</h4>
<p>Is it because HirId doesn't have any usage in extern crate (since MIR has been serialized, not HIR), that's why any HirId related properties moved to ClearCrossCrate?</p>



<a name="228104479"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SourceScopeData%20in%20.rmeta/near/228104479" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SourceScopeData.20in.20.2Ermeta.html#228104479">(Feb 28 2021 at 04:32)</a>:</h4>
<p>I'm not sure what you mean by "any usage" but HIR is never serialized cross-crate</p>



<a name="228106354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SourceScopeData%20in%20.rmeta/near/228106354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Shihao Xia <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SourceScopeData.20in.20.2Ermeta.html#228106354">(Feb 28 2021 at 05:13)</a>:</h4>
<p>Oh I mean a HIR ID from extern crate is not meaningful in local crate since no HIR serialized into rlib's metadata</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>